﻿<%@ Page Language="C#" MasterPageFile="~/Shared/MainPage.Master" AutoEventWireup="true"
    CodeBehind="BillList.aspx.cs" Inherits="Runda.CMS.Portal.SyncManage.BillList" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>
<%@ Register Assembly="RadCalendar.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" runat="server">

  <script src="../Content/global.js" type="text/javascript"></script>
  <link href="../Content/Find/find.css" rel="stylesheet" type="text/css" />
    <link href="../Content/global.css" rel="stylesheet" type="text/css" />
    <link href="../Content/Menu/Menu.css" rel="stylesheet" type="text/css" />
    <link href="../Content/Grid/Grid.css" rel="stylesheet" type="text/css" />

    <script src="../Content/Grid/map_grid.js" type="text/javascript"></script>

    <link href="../Content/Pager.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" src="../Content/jquery-1.3.2.js"></script>

    <script type="text/javascript" src="../Content/Bussiness/datasync.js"></script>

    <script type="text/javascript">
        function OpenBillDetail(billGUID) {
            openMyFullWin('BillDetailList.aspx?billGUID=' + billGUID, 'billDetail');
        }
        function syncData(v) {
            //TODO 待同步调用
            sync(v);
        }

        function initMsg(a) {
            var label1 = document.getElementById('<%=lblMsg.ClientID %>');
            label1.enabled = false;
            label1.innerText = a;
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphBody" runat="server">
    <div class="Container">
        <table id="appFind" class="find" cellspacing="0" cellpadding="0" border="0">
            <tbody>
                <tr height="23">
                    <td class="wizHead" colspan="7">
                        <table style="table-layout: fixed; font-size: 9pt" cellspacing="0" cellpadding="0"
                            width="100%" height="100%">
                            <colgroup>
                                <col>
                                <col width="60">
                                <col width="60">
                                <tr>
                                    <td style="color: #ffffff">
                                        <b>快速查询</b>
                                    </td>
                                    <td class="icMenu mnuRight" nowrap>
                                    </td>
                                </tr>
                        </table>
                    </td>
                </tr>
                <tr id="__appFind_trQuery" height="40">
                    <td class="wizBox1" colspan="7">
                        <table id="__appFind_tbQuery1" style="table-layout: fixed; font-size: 9pt" height="100%"
                            cellspacing="0" cellpadding="0" width="100%">                             
                            <tr>
                                <td align="right" style="width:150px">
                                    按客户名称或地址：
                                </td>
                                <td align="left">
                                    <asp:TextBox ID="txtContractCodeBasic" runat="server" Width="260px" CssClass="input"></asp:TextBox>
                                </td> 
                                <td align="right" style="width:90px">
                                    发票号码：
                                </td>
                                <td align="left">
                                    <asp:TextBox ID="txtcBVCode" runat="server" Width="120px" CssClass="input"></asp:TextBox>
                                </td>                             
                            </tr>
                            <tr>
                                <td align="right" style="width:150px">
                                    发票日期：
                                </td>
                                <td colspan="3" align="left">
                                    <rad:RadDatePicker ID="txtdDateFrom" runat="server" Culture="Chinese (People's Republic of China)"
                                        Skin="WebBlue" Width="200px">
                                        <DateInput Skin="WebBlue">
                                        </DateInput>
                                        <Calendar Skin="WebBlue">
                                        </Calendar>
                                    </rad:RadDatePicker>
                                    ~
                                    <rad:RadDatePicker ID="txtdDateTo" runat="server" Culture="Chinese (People's Republic of China)"
                                        Skin="WebBlue" Width="200px">
                                        <DateInput Skin="WebBlue">
                                        </DateInput>
                                        <Calendar Skin="WebBlue">
                                        </Calendar>
                                    </rad:RadDatePicker>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" style="width:150px">
                                    开票金额：
                                </td>
                                <td colspan="3" align="left">
                                    <asp:TextBox ID="txtAmountFrom" runat="server" Width="190px" CssClass="input"></asp:TextBox>
                                    &nbsp;~&nbsp;
                                    <asp:TextBox ID="txtAmountTo" runat="server" Width="190px" CssClass="input"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" style="width:150px">
                                    账期开始日期：
                                </td>
                                <td colspan="3" align="left">
                                    <rad:RadDatePicker ID="txtdidDueDteFrom" runat="server" Culture="Chinese (People's Republic of China)"
                                        Skin="WebBlue" Width="200px">
                                        <DateInput Skin="WebBlue">
                                        </DateInput>
                                        <Calendar Skin="WebBlue">
                                        </Calendar>
                                    </rad:RadDatePicker>
                                    ~
                                    <rad:RadDatePicker ID="txtdidDueDteTo" runat="server" Culture="Chinese (People's Republic of China)"
                                        Skin="WebBlue" Width="200px">
                                        <DateInput Skin="WebBlue">
                                        </DateInput>
                                        <Calendar Skin="WebBlue">
                                        </Calendar>
                                    </rad:RadDatePicker>
                                </td>
                            </tr>
                            <tr>
                            <td align="right"valign ="middle">排序列：</td>
                            <td align="left"valign ="middle">   
                                <asp:DropDownList ID="ddlOrderby" runat="server" 
                                    onselectedindexchanged="ddlOrderby_SelectedIndexChanged">
                                    <asp:ListItem Value="cBVCode">发票号</asp:ListItem>
                                    <asp:ListItem Selected="True" Value="dDate">发票日期</asp:ListItem>
                                    <asp:ListItem Value="iNatSumTotal">开票金额</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td align="right" colspan="2">   <asp:Button ID="btnSearchBasic" runat="server" Text="查找" CssClass="button" OnClick="btnSearch_Click" /></td> 
                            </tr>
                        </table>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    <div class="Container">
        <table class="mnubar" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td style="padding-left: 5px" nowrap>
                        <b>单据列表</b>
                    </td>
                    <td style="padding-left: 5px">
                        <img src="../Content/Grid/separator.gif">
                    </td>
                    <td class="icMenu" nowrap>
                        <span class="menu" tabindex="0" menu="appGridMenu_mainmnu">操作<img src="../Content/Grid/mnuDown.gif">
                            <table id="appGridMenu_mainmnu" class="mnuList" cellspacing="0" cellpadding="3">
                                <colgroup>
                                    <col class="mnuLeft">
                                    <col class="mnuItm">
                                    <col align="right" width="20">
                                    <tbody>
                                        <tr tabindex="0" action="syncData('bill')">
                                            <td>
                                            </td>
                                            <td colspan="2" nowrap>
                                                <asp:LinkButton ID="lnkbtnSync" runat="server">数据同步</asp:LinkButton>
                                            </td>
                                        </tr>
                                    </tbody>
                            </table>
                        </span>
                    </td>
                    <td class="icMenu mnuRight" nowrap>
                        <span class="menu"></span>
                    </td>
                </tr>
            </tbody>
        </table>
        <div style="border-bottom: #c2c2bf 1px solid; border-top: #969693 1px solid">
        </div>
        <asp:Repeater ID="RepeaterBills" runat="server" OnItemCommand="RepeaterBills_ItemCommand"
            OnItemDataBound="RepeaterBills_ItemDataBound">
            <HeaderTemplate>
                <table id="grid" class="grid" cellspacing="0" cellpadding="0">
                    <tbody>
                        <tr class="header">
                            <td align="middle">
                                <div>
                                    <div style="display: inline; float: left; height: auto; overflow: hidden; width: 96%;
                                        text-align: center;">
                                        发票编号</div>
                                    <div style="display: inline; float: right; height: auto; overflow: hidden;">
                                        <img src="../Content/Grid/bar_line.gif" border="0"></div>
                                </div>
                            </td>
                            <td align="middle">
                                <div>
                                    <div style="display: inline; float: left; height: auto; overflow: hidden; width: 96%;
                                        text-align: center;">
                                        开票日期</div>
                                    <div style="display: inline; float: right; height: auto; overflow: hidden;">
                                        <img src="../Content/Grid/bar_line.gif" border="0"></div>
                                </div>
                            </td>
                            <td align="middle">
                                <div>
                                    <div style="display: inline; float: left; height: auto; overflow: hidden; width: 96%;
                                        text-align: center;">
                                        账期开始日期</div>
                                    <div style="display: inline; float: right; height: auto; overflow: hidden;">
                                        <img src="../Content/Grid/bar_line.gif" border="0"></div>
                                </div>
                            </td>
                            <td align="middle">
                                <div>
                                    <div style="display: inline; float: left; height: auto; overflow: hidden; width: 96%;
                                        text-align: center;">
                                        客户</div>
                                    <div style="display: inline; float: right; height: auto; overflow: hidden;">
                                        <img src="../Content/Grid/bar_line.gif" border="0"></div>
                                </div>
                            </td>
                            <td align="middle">
                                <div>
                                    <div style="display: inline; float: left; height: auto; overflow: hidden; width: 96%;
                                        text-align: center;">
                                        发票金额</div>
                                    <div style="display: inline; float: right; height: auto; overflow: hidden;">
                                        <img src="../Content/Grid/bar_line.gif" border="0"></div>
                                </div>
                            </td>
                            <td align="middle">
                                <div>
                                    <div style="display: inline; float: left; height: auto; overflow: hidden; width: 96%;
                                        text-align: center;">
                                        累计收款额</div>
                                    <div style="display: inline; float: right; height: auto; overflow: hidden;">
                                        <img src="../Content/Grid/bar_line.gif" border="0"></div>
                                </div>
                            </td>
                            <td align="middle">
                                <div>
                                    <div style="display: inline; float: left; height: auto; overflow: hidden; width: 96%;
                                        text-align: center;">
                                        差额</div>
                                    <div style="display: inline; float: right; height: auto; overflow: hidden;">
                                        <img src="../Content/Grid/bar_line.gif" border="0"></div>
                                </div>
                            </td>
                            <td width="14">
                                <asp:ImageButton ID="imgbtnRefersh" CommandName="refersh" runat="server" ImageUrl="../Content/Grid/grid_Refresh.gif"
                                    AlternateText="刷新列表" />
                            </td>
                        </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr class="data" onclick="handleClick()">
                    <td>
                        <%--<%#Eval("cBVCode")%>--%>
                        <asp:Label runat="server"  ID="lblcBVCode" Text='<%#Eval("cBVCode") %>'></asp:Label>
                    </td>
                    <td>
                        <%#string.Format("{0:yyyy/MM/dd}", Eval("dDate"))%>
                    </td>
                    <td>
                        <asp:Label runat="server"  ID="lbliDueDte" Text='<%#string.Format("{0:yyyy/MM/dd}", Eval("idDueDte"))%>'></asp:Label>
                        <asp:LinkButton ID="lnkbtnSave" runat="server" Text="修改" CommandName="update"></asp:LinkButton>
                    </td>
                    <td>
                        <asp:Label runat="server" ID="lblCustomerName"></asp:Label>
                        <asp:Label runat="server"  ID="lblcustomerCode" Visible="false" Text='<%#Eval("cCusCode") %>'></asp:Label>
                    </td>
                    <td>
                        <%#Eval("iNatSumTotal")%>
                    </td>
                    <td>
                        <%#Eval("iExchSumTotal")%>
                    </td>
                    <td>
                        <%# Eval("SubstrctTotal") %>
                    </td>
                    <td>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </tbody> </table>
            </FooterTemplate>
        </asp:Repeater>
        <webdiyer:AspNetPager ID="AspNetPager1" runat="server" CssClass="paginator" CurrentPageButtonClass="cpb" PageSize="15"
            CustomInfoHTML="第%CurrentPageIndex%页，共%PageCount%页，每页%PageSize%条" FirstPageText="首页"
            LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页" ShowCustomInfoSection="Left"
            Width="100%" LayoutType="Table" SubmitButtonClass="but" SubmitButtonText="转到"
            OnPageChanged="AspNetPager1_PageChanged">
        </webdiyer:AspNetPager>
        
        <table class="mnubar" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td style="padding-left: 5px" nowrap>
                        <b>调整发票账期开始日期、手工更新奖惩数据</b>
                    </td>
                    <td style="padding-left: 5px">
                        <img src="../Content/Grid/separator.gif">
                    </td>
                </tr>
            </tbody>
        </table>
        
        <table cellspacing="2" cellpadding="2">
            <tbody>
                <tr>
                    <td style="padding-left: 5px" nowrap>
                        发票号：
                    </td>
                    <td style="padding-left: 5px">
                        <asp:TextBox ID="txtBillNo" runat="server"></asp:TextBox>
                    </td>
                    <td style="padding-left: 5px" nowrap>
                        发票账期开始日期：
                    </td>
                    <td style="padding-left: 5px">
                        <rad:RadDatePicker ID="dDueDate" runat="server" Culture="Chinese (People's Republic of China)"
                                        Skin="WebBlue" Width="120px">
                                        <DateInput Skin="WebBlue">
                                        </DateInput>
                                        <Calendar Skin="WebBlue">
                                        </Calendar>
                                    </rad:RadDatePicker>
                    </td>
                    <td><asp:Button ID="btnSave" runat="server" Text="更新" CssClass="button" 
                            onclick="btnSave_Click"/></td>
                </tr>
                <tr>
                <td style="padding-left: 5px" nowrap>
                        奖惩月份：
                    </td>
                <td style="padding-left: 5px">
                        <rad:RadDatePicker ID="performanceDate" runat="server" Culture="Chinese (People's Republic of China)"
                                        Skin="WebBlue" Width="120px">
                                        <DateInput Skin="WebBlue">
                                        </DateInput>
                                        <Calendar Skin="WebBlue">
                                        </Calendar>
                                    </rad:RadDatePicker>
                    </td>
                <td colspan="2"><asp:Button ID="btnCalc" runat="server" Width ="120px" Text="更新应收款奖惩" 
                        CssClass="button" onclick="btnCalc_Click" OnClientClick="initMsg('正在更新应收款奖惩数据，请稍等...');"/></td>
                 <td><asp:Label runat="server" ID="lblMsg" Font-Bold="True" Font-Names="宋体"
                         ForeColor="#009900"></asp:Label></td>
                </tr>
            </tbody>
        </table>
        
        
    </div>
    <div id="__divRuning" style="position: absolute; z-index: 108; width: 260px; height: 47px;
        background-color: white; border: #9E9E9B 1px solid; font: bold 14px; color: #FF5A00;
        text-align: center; padding-top: 16px; display: none;">
        数据同步中，请稍候...
    </div>
</asp:Content>
